-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Guo Jingxue] iP #237
base: master
Are you sure you want to change the base?
[Guo Jingxue] iP #237
Conversation
This reverts commit 44763c2.
1. ToDos: tasks without any date/time attached to it e.g., visit new theme park 2. Deadlines: tasks that need to be done before a specific date/time e.g., submit report by 11/10/2019 5pm 3. Events: tasks that start at a specific time and ends at a specific time e.g., team project meeting on 2/10/2019 2-4pm
…er the task list changes - Add ability to load the data from the hard disk when Duke starts up
- Add print statement if the list is empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Few nits to work out, and the main method may be way too long.
src/main/java/Duke.java
Outdated
while (sc1.hasNextLine()) { | ||
data = sc1.nextLine(); | ||
String[] dataSplit = data.split(" \\| "); | ||
switch (dataSplit[0]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should check the switch identation
src/main/java/Events.java
Outdated
|
||
@Override | ||
public String toString() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid leaving spaces!
src/main/java/Duke.java
Outdated
+ "| |_| | |_| | < __/\n" | ||
+ "|____/ \\__,_|_|\\_\\___|\n"; | ||
System.out.println("Hello from\n" + logo); | ||
int counter = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should avoid overly long methods that take up more than the space in a computer screen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Overall looks not bad!
No problem with any variable names 👍 But perhaps can private attributes for better encapsulation.
And also, since main method is pretty long, might be good idea to use blank lines to split up logical sections for easier readability!
src/main/java/Deadlines.java
Outdated
import java.time.format.DateTimeFormatter; | ||
|
||
public class Deadlines extends Task { | ||
LocalDate deadLine; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to private attributes for encapsulation 👍
src/main/java/ToDos.java
Outdated
@@ -0,0 +1,11 @@ | |||
public class ToDos extends Task { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps use singular form (ToDo) since plural form usually represents a collection of objects, eg. List
src/main/java/Duke.java
Outdated
switch (inputSplit[0]){ | ||
case "done": | ||
if (inputSplit.length < 2){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor but remember to leave white space before "{" just for consistency and readability 😄
src/main/java/Deadlines.java
Outdated
|
||
@Override | ||
public String toString() { | ||
return "[D] " + super.toString() + "(by: " + deadLine.format(DateTimeFormatter.ofPattern("MMM d yyyy")) + ")"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you could try having this over two lines?
Quoting the java coding standards:
Try to keep line length shorter than 110 characters (soft limit). But it is OK to exceed the limit slightly (hard limit: 120 chars).
I think the line currently is 110+ characters, but it may improve readability slightly if placed over two lines.
src/main/java/Task.java
Outdated
this.eventName = eventName; | ||
this.eventType = eventType; | ||
} | ||
public void setDone() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to add an empty line between the class constructor and the method, so that there is better readability?
src/main/java/Events.java
Outdated
String time; | ||
|
||
public Events(boolean isDone, String eventName, String time) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see an empty line here, but not in your constructors for your other classes. Perhaps you could remove this empty line to make it consistent with the rest?
Hi, very clear code overall! |
Improve code quality
Use Assertions
Allow command to be in lower or upper case or mixed
Update user guide
No description provided.